function(glCreateSampleGTC NAME)
	set(SAMPLE_NAME ${GL_PROFILE_GTC}-${GL_VERSION_GTC}-${NAME})
	set(SHADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../data/${GL_PROFILE_GTC}-${GL_VERSION_GTC})

	foreach(FILE ${GL_SHADER_GTC})
 		set(SHADER_PATH ${SHADER_PATH} ${SHADER_DIR}/${FILE})
	endforeach(FILE)

	source_group("Shader Files" FILES ${SHADER_PATH})
	add_executable(${SAMPLE_NAME} ${GL_PROFILE_GTC}-${GL_VERSION_GTC}-${NAME} ${SHADER_PATH})
	add_custom_command(
		TARGET ${NAME} POST_BUILD
		COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data)
	add_custom_command(
		TARGET ${NAME} POST_BUILD
		COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_BINARY} ${CMAKE_CURRENT_BINARY_DIR})

	add_test(NAME ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
	add_dependencies(${SAMPLE_NAME} ${TARGET_DATA_COPY})
if(MSVC)
	target_link_libraries(${SAMPLE_NAME} ${BINARY_FILES})
else(MSVC)
	target_link_libraries(${SAMPLE_NAME} ${BINARY_FILES} GLEW glut)
endif(MSVC)
endfunction(glCreateSampleGTC)

#add_subdirectory(gl-alpha-to-coverage)
#add_subdirectory(gl-buffer-render)

# OpenGL ES 2.0 samples
set(GL_PROFILE_GTC es)
set(GL_VERSION_GTC 200)
set(GL_SHADER_GTC flat-color.vert flat-color.frag)
glCreateSampleGTC(draw-elements)

# OpenGL 3.0 samples
set(GL_PROFILE_GTC gl)
set(GL_VERSION_GTC 300)

set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(fbo-multisample)
glCreateSampleGTC(test-alpha)

# OpenGL 3.3 samples
set(GL_VERSION_GTC 330)

set(GL_SHADER_GTC blend-index.vert blend-index.frag)
glCreateSampleGTC(blend-index)
set(GL_SHADER_GTC mrt.vert mrt.frag image-2d.vert image-2d.frag)
glCreateSampleGTC(blend-rtt)
set(GL_SHADER_GTC flat-color.vert flat-color.frag)
glCreateSampleGTC(buffer-type)
set(GL_SHADER_GTC uniform-buffer.vert uniform-buffer.frag)
glCreateSampleGTC(buffer-uniform)
glCreateSampleGTC(buffer-uniform-shared)
set(GL_SHADER_GTC flat-color.vert flat-color.frag)
glCreateSampleGTC(buffer-update)
set(GL_SHADER_GTC flat-color.vert flat-color.frag)
glCreateSampleGTC(draw-base-vertex)
set(GL_SHADER_GTC draw-without-vertex-attrib.vert draw-without-vertex-attrib.frag)
glCreateSampleGTC(draw-without-vertex-attrib)
set(GL_SHADER_GTC instanced.vert instanced.frag)
glCreateSampleGTC(draw-instanced)
set(GL_SHADER_GTC instanced-array.vert instanced-array.frag)
glCreateSampleGTC(draw-instanced-array)
glCreateSampleGTC(draw-instanced-array-dsa-gtc)
set(GL_SHADER_GTC flat-color.vert flat-color.frag)
glCreateSampleGTC(draw-multiple)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(fbo-blit)
set(GL_SHADER_GTC rtt-array.vert rtt-array.frag layer.vert layer.geom layer.frag)
glCreateSampleGTC(fbo-layered)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(fbo-mipmaps)
set(GL_SHADER_GTC image-2d.vert image-2d.frag multiple-output.vert multiple-output.frag)
glCreateSampleGTC(fbo-rtt)
set(GL_SHADER_GTC rtt-array.vert rtt-array.frag multiple-output.vert multiple-output.frag)
glCreateSampleGTC(fbo-rtt-texture-array)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(sync)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(fbo-multisample)
set(GL_SHADER_GTC multisample-explicit-texture.vert multisample-explicit-texture.frag multisample-explicit-near.frag multisample-explicit-box.frag)
glCreateSampleGTC(fbo-multisample-explicit)
set(GL_SHADER_GTC multisample-explicit-texture-nv.vert multisample-explicit-texture-nv.frag multisample-explicit-near-nv.frag multisample-explicit-box-nv.frag)
glCreateSampleGTC(fbo-multisample-explicit-nv)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(fbo-srgb)
set(GL_SHADER_GTC discard.vert discard.frag)
glCreateSampleGTC(glsl-discard)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(texture-2d)
set(GL_SHADER_GTC texture-3d.vert texture-3d.frag)
glCreateSampleGTC(texture-3d)
set(GL_SHADER_GTC texture-format.vert texture-format-normalized.frag texture-format-uint.frag texture-format-int.frag)
glCreateSampleGTC(texture-format)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(texture-pixel-store)
glCreateSampleGTC(texture-compressed-ext)
glCreateSampleGTC(texture-streaming)
glCreateSampleGTC(texture-swizzle)
set(GL_SHADER_GTC texture-array.vert texture-array.frag)
glCreateSampleGTC(texture-array)
set(GL_SHADER_GTC texture-cube.vert texture-cube.frag)
glCreateSampleGTC(texture-cube)
set(GL_SHADER_GTC texture-rect.vert texture-rect.frag)
glCreateSampleGTC(texture-rect)
set(GL_SHADER_GTC texture-buffer.vert texture-buffer.frag)
glCreateSampleGTC(texture-buffer)
set(GL_SHADER_GTC front-face.vert front-face.frag)
glCreateSampleGTC(primitive-front-face)
set(GL_SHADER_GTC point.vert point.frag)
glCreateSampleGTC(primitive-point)
set(GL_SHADER_GTC point-sprite.vert point-sprite.frag)
glCreateSampleGTC(primitive-point-sprite)
set(GL_SHADER_GTC smooth-shading-geom.vert smooth-shading-geom.geom smooth-shading-geom.frag smooth-shading.vert smooth-shading.frag)
glCreateSampleGTC(primitive-smooth-shading)
set(GL_SHADER_GTC flat-color.vert flat-color.frag)
glCreateSampleGTC(query-conditional)
glCreateSampleGTC(query-occlusion)
glCreateSampleGTC(query-timer)
glCreateSampleGTC(rasterizer-viewport)
set(GL_SHADER_GTC r2vb1.vert r2vb1.frag r2vb2.vert r2vb2.frag)
#glCreateSampleGTC(render2vertexbuffer)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(sampler-anisotropy-ext)
glCreateSampleGTC(sampler-filter)
glCreateSampleGTC(sampler-object)
set(GL_SHADER_GTC sampler.vert sampler-offset.frag sampler-bicubic.frag)
glCreateSampleGTC(sampler-offset)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(sampler-wrap)
set(GL_SHADER_GTC fetch.vert fetch.frag)
glCreateSampleGTC(sampler-fetch)
set(GL_SHADER_GTC image-2d.vert image-2d.frag)
glCreateSampleGTC(test-scissor)
set(GL_SHADER_GTC feedback-interleaved.vert feedback-interleaved.frag transform-interleaved.vert)
glCreateSampleGTC(transform-feedback-interleaved)
set(GL_SHADER_GTC feedback-separated.vert feedback-separated.frag transform-separated.vert)
glCreateSampleGTC(transform-feedback-separated)

# OpenGL 4.0 samples
set(GL_VERSION_GTC 400)

set(GL_SHADER_GTC mrt.vert mrt.frag image-2d.vert image-2d.frag)
glCreateSampleGTC(blend-rtt)
set(GL_SHADER_GTC flat-color.vert flat-color.frag)
glCreateSampleGTC(draw-indirect)
set(GL_SHADER_GTC rtt-array.vert rtt-array.frag layer.vert layer.geom layer.frag)
glCreateSampleGTC(fbo-layered)
set(GL_SHADER_GTC multisample.vert multisample.frag)
glCreateSampleGTC(fbo-multisample)
set(GL_SHADER_GTC fbo-rtt.vert fbo-rtt.frag)
glCreateSampleGTC(fbo-rtt)
set(GL_SHADER_GTC rtt-array.vert rtt-array.frag)
glCreateSampleGTC(fbo-rtt-texture-array)
set(GL_SHADER_GTC double.vert double.frag)
glCreateSampleGTC(program-64)
set(GL_SHADER_GTC subroutine.vert subroutine.frag)
glCreateSampleGTC(program-subroutine)
set(GL_SHADER_GTC tess-block.vert tess-block.cont tess-block.eval tess-block.geom tess-block.frag)
glCreateSampleGTC(program-varying-blocks)
set(GL_SHADER_GTC tess-struct.vert tess-struct.cont tess-struct.eval tess-struct.geom tess-struct.frag)
glCreateSampleGTC(program-varying-structs)
set(GL_SHADER_GTC primitive-instancing.vert primitive-instancing.geom primitive-instancing.frag)
glCreateSampleGTC(primitive-instanced)
set(GL_SHADER_GTC tess.vert tess.cont tess.eval tess.geom tess.frag)
glCreateSampleGTC(primitive-tessellation)
set(GL_SHADER_GTC tess.vert tess.cont tess.eval tess.geom tess.frag smooth-shading-geom.vert smooth-shading-geom.geom smooth-shading-geom.frag)
glCreateSampleGTC(primitive-smooth-shading)
set(GL_SHADER_GTC fetch.vert fetch.frag)
glCreateSampleGTC(sampler-fetch)
set(GL_SHADER_GTC gather.vert gather.frag)
glCreateSampleGTC(sampler-gather)
set(GL_SHADER_GTC sampler-array.vert sampler-array.frag)
glCreateSampleGTC(sampler-array)
set(GL_SHADER_GTC sampler-array-nv.vert sampler-array-nv.frag)
glCreateSampleGTC(sampler-array-nv)
set(GL_SHADER_GTC texture-buffer.vert texture-buffer.frag)
glCreateSampleGTC(texture-buffer-rgb)
set(GL_SHADER_GTC feedback.vert feedback.frag transform.vert)
glCreateSampleGTC(transform-feedback-object)
set(GL_SHADER_GTC feedback-stream-point.vert feedback-stream-point.frag feedback-stream-strip.vert feedback-stream-strip.frag transform-stream.vert transform-stream.geom)
glCreateSampleGTC(transform-feedback-stream)

# OpenGL 4.1 samples
set(GL_VERSION_GTC 410)

set(GL_SHADER_GTC viewport.vert viewport.geom viewport.frag layer.vert layer.geom layer.frag)
glCreateSampleGTC(fbo-layered)
set(GL_SHADER_GTC primitive-instancing.vert primitive-instancing.geom primitive-instancing.frag)
glCreateSampleGTC(primitive-instanced)
set(GL_SHADER_GTC tess.vert tess.cont tess.eval tess.geom tess.frag)
glCreateSampleGTC(primitive-tessellation-2)
glCreateSampleGTC(primitive-tessellation-5)
set(GL_SHADER_GTC double.vert double.frag)
glCreateSampleGTC(program-64)
set(GL_SHADER_GTC binary.vert binary.geom binary.frag)
glCreateSampleGTC(program-binary)
set(GL_SHADER_GTC separate.vert separate.frag)
glCreateSampleGTC(program-separate)

# OpenGL 4.2 samples
set(GL_VERSION_GTC 420)

set(GL_SHADER_GTC atomic-counter.vert atomic-counter.frag)
glCreateSampleGTC(atomic-counter)
set(GL_SHADER_GTC blend-op-amd.vert blend-op-amd.frag texture-2d.vert texture-2d.frag)
glCreateSampleGTC(blend-op-amd)
set(GL_SHADER_GTC buffer-barrier.vert buffer-barrier.frag)
glCreateSampleGTC(buffer-barrier-gtc)
set(GL_SHADER_GTC buffer-uniform.vert buffer-uniform.frag)
glCreateSampleGTC(buffer-uniform)
set(GL_SHADER_GTC buffer-pinned-amd.vert buffer-pinned-amd.frag)
glCreateSampleGTC(buffer-pinned-amd)
set(GL_SHADER_GTC clipping.vert clipping.frag)
glCreateSampleGTC(clipping)
set(GL_SHADER_GTC debug-output.vert debug-output.frag)
glCreateSampleGTC(debug-output)
#glCreateSampleGTC(direct-state-access-gtc)
set(GL_SHADER_GTC draw-base-instance.vert draw-base-instance.frag)
glCreateSampleGTC(draw-base-instance)
set(GL_SHADER_GTC texture-2d.vert texture-2d.frag)
glCreateSampleGTC(fbo-multisample-dsa-nv)
set(GL_SHADER_GTC multisample-amd.vert multisample-amd.frag)
glCreateSampleGTC(fbo-multisample-position-amd)
set(GL_SHADER_GTC viewport-amd.vert viewport-amd.frag layer-amd.vert layer-amd.frag)
glCreateSampleGTC(fbo-layered-amd)
set(GL_SHADER_GTC fbo-srgb-decode.vert fbo-srgb-decode.frag)
glCreateSampleGTC(fbo-srgb-decode-ext)
set(GL_SHADER_GTC interop.comp interop.vert interop.frag)
#glCreateSampleGTC(interop)
set(GL_SHADER_GTC interface-matching.vert interface-matching.cont interface-matching.eval interface-matching.geom interface-matching.frag)
glCreateSampleGTC(interface-matching)
set(GL_SHADER_GTC image-load.vert image-load.frag)
glCreateSampleGTC(image-load)
set(GL_SHADER_GTC image-store-write.vert image-store-write.frag image-store-read.vert image-store-read.frag)
glCreateSampleGTC(image-store)
set(GL_SHADER_GTC image-unpack.vert image-unpack.frag)
glCreateSampleGTC(image-unpack)
set(GL_SHADER_GTC memory-barrier-update.vert memory-barrier-update.frag memory-barrier-blit.vert memory-barrier-blit.frag)
glCreateSampleGTC(memory-barrier)
set(GL_SHADER_GTC picking.vert picking.frag picking.geom)
glCreateSampleGTC(picking)
set(GL_SHADER_GTC texture-2d.vert texture-2d.frag)
glCreateSampleGTC(primitive-bindless-nv)
set(GL_SHADER_GTC sampler-fetch.vert sampler-fetch.frag sampler-library.frag)
glCreateSampleGTC(sampler-fetch)
set(GL_SHADER_GTC test-depth-clamp-separate.vert test-depth-clamp-separate.frag)
glCreateSampleGTC(test-depth-clamp-separate-amd)
set(GL_SHADER_GTC test-depth-conservative.vert test-depth-conservative.frag)
glCreateSampleGTC(test-depth-conservative)
set(GL_SHADER_GTC texture-bindless-nv.vert texture-bindless-nv.frag)
glCreateSampleGTC(texture-bindless-nv)
set(GL_SHADER_GTC texture-cube.vert texture-cube.frag)
glCreateSampleGTC(texture-cube)
set(GL_SHADER_GTC texture-2d.vert texture-2d.frag)
glCreateSampleGTC(texture-pixel-store)
set(GL_SHADER_GTC texture-shadow-color.vert texture-shadow-color.frag texture-shadow-depth.vert texture-shadow-depth.frag)
#glCreateSampleGTC(texture-shadow)
set(GL_SHADER_GTC texture-2d.vert texture-2d.frag)
glCreateSampleGTC(texture-storage)
set(GL_SHADER_GTC texture-conversion.vert texture-conversion-uint.frag texture-conversion-normalized.frag)
glCreateSampleGTC(texture-conversion)
set(GL_SHADER_GTC texture-2d.vert texture-2d.frag)
glCreateSampleGTC(texture-compressed)
set(GL_SHADER_GTC feedback-stream.vert feedback-stream.frag transform-stream.vert transform-stream.geom)
glCreateSampleGTC(transform-feedback-instanced)

# OpenGL 4.3 samples
set(GL_VERSION_GTC 430)

set(GL_SHADER_GTC atomic-counter.vert atomic-counter.frag)
glCreateSampleGTC(atomic-counter)
set(GL_SHADER_GTC dsa-pass1.frag dsa-pass1.vert dsa-pass2-msaa-box.frag dsa-pass2-msaa-near.frag)
glCreateSampleGTC(direct-state-access-ext)
set(GL_SHADER_GTC draw-without-vertex-attrib.vert draw-without-vertex-attrib.frag)
glCreateSampleGTC(draw-without-vertex-attrib)
set(GL_SHADER_GTC image-store-write.vert image-store-write.frag image-store-read.vert image-store-read.frag)
glCreateSampleGTC(image-store)
set(GL_SHADER_GTC interface-matching.vert interface-matching.cont interface-matching.eval interface-matching.geom interface-matching.frag)
glCreateSampleGTC(interface-matching)
set(GL_SHADER_GTC multi-draw-indirect.vert multi-draw-indirect.frag)
glCreateSampleGTC(multi-draw-indirect)
set(GL_SHADER_GTC program-compute.vs program-compute.fs program-compute.cs)
glCreateSampleGTC(program-compute)
set(GL_SHADER_GTC texture-copy.vert texture-copy.frag)
glCreateSampleGTC(texture-copy)
set(GL_SHADER_GTC texture-view.vert texture-view.geom texture-view.frag)
glCreateSampleGTC(texture-view)

